<!--
 * @Descripttion: 出手鸭小程序
 * @version:1.0.1 
 * @Author: HHL
 * @Date: 2023-10-08 10:46:41
 * @LastEditTime: 2025-07-03 08:45:32
 * @LastEditors: sueRimn
-->


<template>
  <view class="order-box">
    <view class="btn-list d-flex align-items-center justify-content-around">
      <view class="item d-flex flex-column align-items-center" v-for="(item, index) in orderBtnList" :key="index" @click="goOrderList(item.id)">
        <common-image :src="item.icon" :styles="'width: 56rpx; height: 56rpx;'" />
        <view class="text">{{ item.name }}</view>
      </view>
    </view>
  </view>
</template>


<script>
export default {
  props: {

  },
  data() {
    return {
      orderBtnList: [
        { id: -1, "name": "待评估", "icon": "https://image.chushouya.com/assets/images/my/icon_dpg.png" },
        { id: 1, "name": "待质检", "icon": "https://image.chushouya.com/assets/images/my/icon_dzj.png" },
        { id: 2, "name": "待收款", "icon": "https://image.chushouya.com/assets/images/my/icon_dsk.png" },
        { id: 3, "name": "待评价", "icon": "https://image.chushouya.com/assets/images/my/icon_dpj.png" },
        { id: 0, "name": "我的订单", "icon": "https://image.chushouya.com/assets/images/my/icon_qb.png" },
      ]
    }
  },
  methods: {
    goOrderList(status = 0) {
      if(status === -1){
        uni.navigateTo({ url: `/pages/category/index` })
        return
      }
      this.$emit('checkAuth', () => {
        uni.navigateTo({ url: `/pages/order/index?status=${status}` })
      })
    },

    // 去估价
    goEvaluate() {
      let url = '/pages/category/index'

      if (this.userEvaluateInfo.productId) {
        url = `/pages/product/index?id=${this.userEvaluateInfo.productId}`
      }

      uni.navigateTo({ url })
    }
  }
}
</script>

<style lang="scss" scoped>
.order-box {
  position: relative;
  padding: 1rpx;

  .btn-list {
    background: #FFFFFF;
    box-shadow: 0px 8rpx 24rpx 0px rgba(0, 0, 0, 0.02);
    border-radius: 24rpx;
    margin: 48rpx 32rpx 0;
    padding: 48rpx 0 42rpx;

    .item {
      font-size: 24rpx;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: var(--hui-color-title);
      .text{
        margin: 5rpx 0 0 0;
      }
    }
  }
}
</style>